<!doctype html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../assert_selection.js"></script>
<div id="log"></div>
<script>
test(() => {
    assert_selection(
        '<ol contenteditable><li>one</li><li>two</li><li>^three|</li><ol><li>four</li></ol></ol>',
        'Indent',
        '<ol contenteditable><li>one</li><li>two</li><ol><li>^three|</li><li>four</li></ol></ol>',
        'Nested list at four');

    assert_selection(
        '<ol contenteditable><li>one</li><ol><li>two</li></ol><li>^three|</li><li>four</li></ol>',
        'Indent',
        '<ol contenteditable><li>one</li><ol><li>two</li><li>^three|</li></ol><li>four</li></ol>',
        'Nested lsit at two');

    assert_selection(
        '<ol contenteditable><li>one</li><ol><li>two</li></ol><li>^three|</li><ol><li>four</li></ol></ol>',
        'Indent',
        '<ol contenteditable><li>one</li><ol><li>two</li><li>^three|</li><li>four</li></ol></ol>',
        'Nested lsit at two and four');

    assert_selection(
        '<ol contenteditable><li>one</li><ol><li>two</li></ol><li>^three</li><li>four|</li><ol><li>five</li></ol></ol>',
        'Indent',
        '<ol contenteditable><li>one</li><ol><li>two</li><li>^three</li><li>four|</li><li>five</li></ol></ol>',
        'Nested lsit at two and four');

    assert_selection(
        '<ol contenteditable><li>one</li><ol><li>two</li></ol><li>^three|</li><ul><li>four</li></ul></ol>',
        'Indent',
        '<ol contenteditable><li>one</li><ol><li>two</li><li>^three|</li></ol><ul><li>four</li></ul></ol>',
        'Nested lsit at two and four(ul); merge three to two');

    assert_selection(
        '<ol contenteditable><li>one</li><ul><li>two</li></ul><li>^three|</li><ol><li>four</li></ol></ol>',
        'Indent',
        '<ol contenteditable><li>one</li><ul><li>two</li></ul><ol><li>^three|</li><li>four</li></ol></ol>',
        'Nested lsit at two(ul) and four; merge three to four');

    assert_selection(
        '<ol contenteditable><li>one</li><ol><li>two</li></ol>aaa<li>^three</li><li>four|</li><ul><li>five</li></ul></ol>',
        'Indent',
        '<ol contenteditable><li>one</li><ol><li>two</li></ol>aaa<ol><li>^three</li><li>four|</li></ol><ul><li>five</li></ul></ol>',
        'Floating test in list');
});
</script>
